//
//  LYSuperViewController.m
//  artist
//
//  Created by laotang on 16/4/10.
//  Copyright © 2016年 viviyoo. All rights reserved.
//

#import "LYSuperViewController.h"

@interface LYSuperViewController ()
@property (nonatomic, copy) void(^rightButtonClickHandle)(void);
@end

@implementation LYSuperViewController

- (UIBarButtonItem *)addLeftButtonWithImage:(UIImage *)image
                                     target:(id)target
                                  andAction:(SEL)action
{
    UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithImage:image
                                                               style:UIBarButtonItemStylePlain
                                                              target:target
                                                              action:action];
    self.navigationItem.leftBarButtonItem = button;
    return button;
}

- (UIBarButtonItem *)addRightButtonWithImage:(UIImage *)image
                                      target:(id)target
                                   andAction:(SEL)action
{
    UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithImage:image
                                                               style:UIBarButtonItemStylePlain
                                                              target:target
                                                              action:action];
    self.navigationItem.rightBarButtonItem = button;
    return button;
}

- (UIBarButtonItem *)addLeftButtonWithTitle:(NSString *)title
                                     target:(id)target
                                  andAction:(SEL)action
{
    UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithTitle:title
                                                               style:UIBarButtonItemStylePlain
                                                              target:target
                                                              action:action];
    self.navigationItem.leftBarButtonItem = button;
    return button;
}


- (UIBarButtonItem *)addRightButtonWithTitle:(NSString *)title
                                      target:(id)target
                                   andAction:(SEL)action
{
    UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithTitle:title style:UIBarButtonItemStylePlain target:target action:action];
    self.navigationItem.rightBarButtonItem = button;
    
    return button;
}

- (UIBarButtonItem *)addRightButtonWithTitle:(NSString *)title handle:(void (^)(void))handle{
    
    
    self.rightButtonClickHandle = [handle copy];
    return  [self addRightButtonWithTitle:title target:self andAction:@selector(rightButtonClick)];
}

- (UIBarButtonItem *)addRightButtonWitImage:(UIImage *)image handle:(void (^)(void))handle{
    
    self.rightButtonClickHandle = [handle copy];
    return  [self addRightButtonWithImage:image target:self andAction:@selector(rightButtonClick)];
    
}



@end
